import request from "@/config/axios";
// 请求树形控件数据
export const queryMyDeptTreeList = (data) =>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/sysDepart/queryMyDeptTreeList`,
        method:'GET'
    }
)
// 获取部门用户信息
export const departUserList = (data) =>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/user/departUserList?column=createTime&order=desc&field=id,,username,realname,orgCode,sex_dictText,phone,action&pageNo=${data.pageNo}&pageSize=${data.pageSize}&depId=${data.depId}`,
        method:'GET',
        data
    }
)
// 获取部门角色
export const departRoleList = (data) =>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/sysDepartRole/list?column=createTime&order=desc&field=id,,roleName,roleCode,departId_dictText,description,action&pageNo=${data.pageNo}&pageSize=${data.pageSize}&deptId=${data.deptId}`,
        method:'GET',
        data
    }
)
// 获取搜索过后的部门角色列表
export const departRoleListSearch = (data) =>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/sysDepartRole/list?_t=1666325902&roleName=${data.roleName}&column=createTime&order=desc&field=id,,roleName,roleCode,departId_dictText,description,action&pageNo=${data.pageNo}&pageSize=${data.pageSize}&deptId=${data.deptId}`,
        method:'GET',
        data
    }
)
// 编辑弹窗部门角色编码校验 
export const departRoleListCheck = (data) =>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/duplicate/check?tableName=sys_depart_role&fieldName=role_code&fieldVal=${data.fieldVal}&dataId=${data.dataId}`,
        method:'GET',
        data
    }
)
// 编辑部门角色
export const editRoleData = (data) =>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/sysDepartRole/edit`,
        method:'PUT',
        data
    }
)
// 添加部门角色
export const addRoleData = (data) =>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/sysDepartRole/add`,
        method:'POST',
        data
    }
)
// 删除部门角色
export const deleteRoleData = (data) =>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/sysDepartRole/deleteBatch?ids=${data},`,
        method:'DELETE',
        data
    }
)
// 单行删除部门角色
export const deleteRoleDataAlone = (data) =>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/sysDepartRole/delete?id=${data}`,
        method:'DELETE',
        data
    }
)
// 获取权限树形控件数据
export const queryTreeListForDeptRole = (data) =>request(
    {
        url:`http://localhost:8080/jeecg-boot/sys/sysDepartPermission/queryTreeListForDeptRole?departId=${data}`,
        method:'GET',
        data
    }
)
// 获取权限树形控件默认选中的复选框数组
export const queryDeptRolePermission = (data) =>request(
    {   
        url:`http://localhost:8080/jeecg-boot/sys/sysDepartPermission/queryDeptRolePermission?roleId=${data}`,
        method:'GET',
        data
    }
)